package com.xique.job.task.elevator;

import com.xique.common.core.web.domain.AjaxResult;
import com.xique.door.api.RemoteElevatorService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author shd
 * @create 2021/10/27 9:33
 */
@Component
@Slf4j
public class ElevatorTask {

    @Autowired
    RemoteElevatorService remoteElevatorService;

    public void syncEventData() {

        AjaxResult result = remoteElevatorService.syncEvent();

        if (AjaxResult.isError(result)) {
            log.error("同步事件集合失败");
        }
    }

    public void syncReportData() {

        AjaxResult result = remoteElevatorService.syncReport();

        if (AjaxResult.isError(result)) {
            log.error("同步运行统计失败");
        }
    }

    public void syncRunData() {

        AjaxResult result = remoteElevatorService.syncRun();

        if (AjaxResult.isError(result)) {
            log.error("同步运行集合失败");
        }
    }
}
